package com.haven123.cloudapp.websocket;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;
@RefreshScope
@RestController
@Slf4j
@EnableCircuitBreaker
@EnableEurekaClient
@EnableFeignClients("com.haven123.cloudapp.websocket.feign")
@SpringBootApplication(scanBasePackages = {"com.haven123.cloudapp.websocket"})
public class App {
    @Value("${from}")
    private String from;
    public static void main(String[] args) {
        SpringApplication.run(App.class, args);

    }
    @RequestMapping("/")
    public String selconfigserver(){
        log.info(from);
        return from;
    }

    public volatile static  Map<Long,WebSocketServer> map=new HashMap<>();
}
